{extend name="index/nav" /}}
{block name="main"}
<link rel="stylesheet" href="/static/adminLogin/js/summernote-master/dist/summernote-lite.css">
<script src="/static/adminLogin/js/summernote-master/dist/jquery-1.11.0.min.js"></script>
<div class="body">
    <div class="">
        <h2>资讯内容编辑</h2>
    </div>
    <div class="">
        <form action="{:url('admin/index/goGameEdit')}" class="am-form am-form-horizontal" role="form" enctype="multipart/form-data" method="post">
            <div class="">
                <label for="doc-ipt-2" class="">游戏名称</label>
                <div class="">
                    <input type="hidden" id="doc-ipt-1" name="game_id"/>
                    <input type="text" id="doc-ipt-2" name="name">
                </div>
            </div>
            <div class="">
                <label for="" class="">游戏简介</label>
                <div class="">
                    <textarea class="introduce" name="introduce"></textarea>
                </div>
            </div>
            <div class="">
                <label for="grade" class="">选择等级</label>
                <div class="">
                    <select name="grade" id="grade">
                        <option value="1">热门游戏</option>
                        <option value="2">游戏</option>
                        <option value="3">强烈推荐</option>
                    </select>
                </div>
            </div>
            <div class="">
                <label for="down" class="">选择等级</label>
                <div class="">
                    <select name="down" id="down">
                        <option value="1">下载</option>
                        <option value="2">敬请期待</option>
                    </select>
                </div>
            </div>
            <div class="">
                <button type="submit" class="btn-default">提交</button>
            </div>
        </form>
    </div>
</div>
<script src="/static/adminLogin/js/summernote-master/dist/summernote-lite.js"></script>
<script src="/static/adminLogin/js/summernote-master/lang/summernote-zh-CN.js"></script>

<script>

    $('#collapse-nav4').addClass('am-in');

    $(function(){
        var arr=document.cookie.split(';');
        var id=arr[0];
        $.post('{:url("admin/index/togameEdit")}',{id:id},function (res) {
            res=JSON.parse(res);
            console.log(res);
            $('#doc-ipt-1').val(res.game_id);
            $('#doc-ipt-2').val(res.name);
            $('.introduce').val(res.introduce);
            $('#grade').val(res.grade);
            $('#down').val(res.down);
        })
    })
</script>
{/block}